<template>
  <h1>{{ msg }}</h1>
  <button @click="count++">count is: {{ count }}</button>
</template>

<script lang="ts">
// import { debounce } from 'lodash'
import { ref, defineComponent } from 'vue'
import fetch from '../network/index'

export default defineComponent({
  name: 'HelloWorld',
  props: {
    msg: {
      type: String,
      required: true
    }
  },
  setup: () => {
    const count = ref(0)
    return { count }
  },
  created() {
    this.getList()
  },
  methods: {
    async getList() {
      const res = await fetch({
        url: '/topics',
        method: 'get',
        params: {
          page: 1,
          tab: 'ask',
          limit: 10,
        }
      });
      console.log(res)
    },
  }
})
</script>

<style scoped>
a {
  color: #42b983;
}

label {
  margin: 0 0.5em;
  font-weight: bold;
}

code {
  background-color: #eee;
  padding: 2px 4px;
  border-radius: 4px;
  color: #304455;
}
</style>
